/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.acionista.entity;

import br.jm.acionista.filter.ConfiguraCampoAnnotation;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "relatorio_certificado", catalog = "acionista", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "RelatorioCertificado.findAll", query = "SELECT r FROM RelatorioCertificado r")})
public class RelatorioCertificado implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_cautela", nullable = false)
    private Integer idCautela;
    @Column(name = "dat_cautela")
    @Temporal(TemporalType.DATE)
    private Date datCautela;
    @Size(max = 60)
    @Column(name = "num_certificado", precision = 18, scale = 0, nullable = false)
    private BigDecimal numCertificado;
    @JoinColumn(name = "id_cliente", referencedColumnName = "id_cliente")
    @ManyToOne
    @ConfiguraCampoAnnotation(tipo="int", pesquisa="idCliente", campo="id_cliente", nomeTabela="cliente", nomeTabelJoin="cliente")
    private Cliente idCliente;

    public RelatorioCertificado() {
    }

    public RelatorioCertificado(Integer idCautela) {
        this.idCautela = idCautela;
    }

    public Integer getIdCautela() {
        return idCautela;
    }

    public void setIdCautela(Integer idCautela) {
        this.idCautela = idCautela;
    }

    public Date getDatCautela() {
        return datCautela;
    }

    public void setDatCautela(Date datCautela) {
        this.datCautela = datCautela;
    }

    public Cliente getIdCliente() {
        return idCliente;
    }

    public void setIdCliente(Cliente idCliente) {
        this.idCliente = idCliente;
    }

    public BigDecimal getNumCertificado() {
        return numCertificado;
    }

    public void setNumCertificado(BigDecimal numCertificado) {
        this.numCertificado = numCertificado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCautela != null ? idCautela.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RelatorioCertificado)) {
            return false;
        }
        RelatorioCertificado other = (RelatorioCertificado) object;
        if ((this.idCautela == null && other.idCautela != null) || (this.idCautela != null && !this.idCautela.equals(other.idCautela))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.acionista.entity.RelatorioCautela[ idCautela=" + idCautela + " ]";
    }


}
